package com.mck.controller;

import com.mck.entity.Result;
import com.mck.entity.ScoreStats;
import com.mck.service.ScoreStatsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author Max
 * @Date 2025/3/16 下午8:28
 */

@RestController
@RequestMapping("/api/public/scoreStats")
@Slf4j
public class ScoreStatsController {

    @Autowired
    private ScoreStatsService scoreStatsService;

    /**
     * 获取成绩统计数据
     */
    @PostMapping
    public Result getScoreStatsList(@RequestBody ScoreStats scoreStats) {
        log.info("获取成绩统计数据");

        List<ScoreStats> scoreStatsList = scoreStatsService.getScoreStatsList(scoreStats);
        return Result.success(scoreStatsList);
    }
}
